from zoukao3.Page.Page import Page
from selenium.webdriver.common.by import By
class Page2(Page):
    # 点击新闻
    news_loc=(By.XPATH,'//*[@id="s-top-left"]/a[1]')
    # 断言是否进入新闻页
    dy3_loc=(By.XPATH,'//*[@id="headline-tabs"]/ul/li/a')
    # 点击查看新闻详情
    seenews_loc=(By.XPATH,'//*[@id="pane-news"]/ul[1]/li[1]/a')

    def news(self):
        self.click(self.news_loc)

    def dy3(self):
        self.text(self.dy3_loc)

    def seenews(self):
        self.click(self.seenews_loc)

    def baidu_luoji_03(self):
        self.baidu_luoji_01()
        self.news()
        # 切换新页面
        self.window()
        # print(self.dy3())
        # assert '热点要闻' ==self.dy3()
        self.seenews()
        # 滚动到底部
        self.scrollTo()